
package testReflect;

import java.io.DataInputStream;
import java.io.FileInputStream;

public class MyClassLoader extends ClassLoader {
    public Class<?> findClass(String className) {
        try {
            DataInputStream dis = new DataInputStream(new FileInputStream("res/RemoteClass.class"));
            byte[] classData = new byte[dis.available()];
            dis.read(classData);
            return defineClass(className, classData, 0, classData.length);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
